
/* eslint-disable */
import request from '@/utils/request';


/** 获取当前的用户 GET /currentUser */
export async function currentUser() {
    return request({url:'/system/user/getInfo',method: 'GET'});
}

/** 退出登录接口 POST */
export async function outLogin() {
    return request({url:'/auth/logout',method: 'POST'});
}

/**
 * 社会化登录
 */
export async function binding(source:string) {
    return request({url:`/auth/binding/${source}`,method: 'get'});
}


/** 获取租户信息接口 GET */
export async function queryTenantList() {
    return request({url:'/auth/tenant/list',method: 'GET'});
}

/** 获取验证码 GET */
export async function getAuthCode() {
    return request({url:'/auth/code',method: 'GET'});
}


/** 登录接口 POST */
export async function login(data:any) {
    return request({url:'/auth/login',method:'post', data,headers: {'Content-Type': 'application/json'}});
}
/** auth2.0授权 */
export async function oauth(platform?:string) {
    return request({url:`/erp/oauth/render/${platform}`,method:'get'});
}


/** 发送验证码 POST /login/captcha */
export async function getSmsCode(
    params: {
        // query
        /** 手机号 */
        phonenumber?: string;
        tenantId?: string;
        //拖动验证码
        ajCaptchaData?: string;
    }
) {
    return request({url:'/resource/sms/code',
        method: 'GET',
        params: {
            ...params,
        }
    });
}